#include "profiledata.h"


namespace Profile {

ProfileData::ProfileData()
{

}


ProfileData::ProfileData(qint64 memberId,
                         const QString &name,
                         const QString &displayName,
                         const QString &firstName,
                         const QString &lastName,
                         const QString &birthday,
                         int gender,
                         const QString &messageStatus,
                         QList<QString> phoneList,
                         const QString &email,
                         const QString &profileUrl,
                         const QString &avatarUrl,
                         const QString &googleId,
                         const QString &yahooId,
                         const QString &city)
    : m_memberId(memberId),
      m_fullName(name),
      m_displayName(displayName),
      m_firstName(firstName),
      m_lastName(lastName),
      m_birthday(birthday),
      m_gender(gender),
      m_messageStatus(messageStatus),
      m_phoneList(phoneList),
      m_email(email),
      m_profileUrl(profileUrl),
      m_avatarUrl(avatarUrl),
      m_googleId(googleId),
      m_yahooId(yahooId),
      m_city(city)
{

}


ProfileData::ProfileData(const ProfileData &copyMe)
{
    m_memberId = copyMe.m_memberId;
    m_fullName = copyMe.m_fullName;
    m_displayName = copyMe.m_displayName;
    m_firstName = copyMe.m_firstName;
    m_lastName = copyMe.m_lastName;
    m_birthday = copyMe.m_birthday;
    m_gender = copyMe.m_gender;
    m_messageStatus = copyMe.m_messageStatus;
    m_email = copyMe.m_email;
    m_profileUrl = copyMe.m_profileUrl;
    m_avatarUrl = copyMe.m_avatarUrl;
    m_phoneList = copyMe.m_phoneList;
    m_googleId = copyMe.m_googleId;
    m_yahooId = copyMe.m_yahooId;
    m_city = copyMe.m_city;
}


ProfileData::~ProfileData()
{
}


ProfileData &ProfileData::operator = (const ProfileData &profile)
{
    m_memberId = profile.m_memberId;
    m_fullName = profile.m_fullName;
    m_displayName = profile.m_displayName;
    m_firstName = profile.m_firstName;
    m_lastName = profile.m_lastName;
    m_messageStatus = profile.m_messageStatus;
    m_email = profile.m_email;
    m_profileUrl = profile.m_profileUrl;
    m_avatarUrl = profile.m_avatarUrl;
    m_phoneList = profile.m_phoneList;
    m_gender = profile.m_gender;
    m_googleId = profile.m_googleId;
    m_yahooId = profile.m_yahooId;
    m_city = profile.m_city;
    m_birthday = profile.m_birthday;
    return *this;
}


void ProfileData::setPhones(const QList<QString> &phones)
{
    m_phoneList = phones;
}


void ProfileData::insertPhone(const QString &phone)
{
    m_phoneList.append(phone);
}


QString ProfileData::phone() const
{
    if (m_phoneList.count() == 0)
        return QString();

    return m_phoneList.first();
}

} // namespace Profile
